package com.txhjava.controller;

import com.txhjava.pojo.User;
import com.txhjava.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * @Title:
 * @Author: Mamba
 * @Description:
 */
@Controller
public class UserController {

    /**
     *
     */
@Autowired
    private UserService userService;
    @RequestMapping("/listUsers")
    public String findUsers(Model model){
        List<User> users = userService.findUsers();
        model.addAttribute("users",users);
        return "user";
    }
}
